home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / assembly / v40chunk.lha / DisplayChunky.s
Text File  |  1995-08-02  |  4KB  |  137 lines

  1. ;--------------------------T------------------T---------------T
  2. ***** Chunky Conversion HW ***** $VER: v1.0 (02.08.95)
  3.  
  4. * I suggest you a little changes in your great code.
  5. * Please make some v40 features for speed up in some systems, what has
  6. * ChunkyToPlanar conversion hardware, ie.:
  7. * - CD32 (+ SX-1) builtin Akiko
  8. * - CyberVision 64 ( Not tested. Owner`s report are welcome.)
  9. * - etc.
  10.  
  11. * Please INSERT this little `display-chunky` into your code, beacuse 
  12. * Graphics/WriteChunkyPixels works 25 times faster, than the
  13. * Graphics/WritePixelArray8 routine in CD32 (+ SX-1 ).
  14. * In 640x480x8:
  15. * WritePixelArray8  takes 3.86 sec
  16. * WriteChunkyPixels takes 0.15 sec
  17. * WriteChunkyPixels takes 0.27 sec in one line per CALL
  18.  
  19. * Graphics/WriteChunkyPixels works on top-speed,
  20. * if you CALL it one time per Picture (ie. GIF).
  21. * If you don`t want to decompress the whole Picture:
  22. * - for instant, contignous displaying,
  23. * - or not enough memory for puffer,
  24. * I suggest: You must decompress more then one lines per CALL,
  25. * beacuse the one line per CALLing will increase
  26. * the displaying speed to 1.82 times slower.
  27.  
  28. * Bug reports and suggestions are welcome.
  29.  
  30. * code by McPhoton of CooL Software
  31. * e-mail: szolim@dragon.klte.hu
  32. * code generated by ASM-One V1.25
  33. ;------------------------------------------------------------------------------
  34. VER_INCLUDES    EQU    40
  35.  
  36.     INCDIR    "INCLUDES:"
  37.  
  38.     INCLUDE    "graphics/gfxbase.i"
  39.     INCLUDE    "lvos/graphics_lib.i"
  40.  
  41.     IFLT    VER_INCLUDES-40
  42. _LVOWriteChunkyPixels    EQU    -1056
  43. gb_ChunkyToPlanarPtr    EQU    508
  44.     ENDC
  45. ;------------------------------------------------------------------------------
  46. ALIGNED    MACRO
  47.     CNOP    0,4
  48.     ENDM
  49.  
  50. GETBASE    MACRO
  51.     move.l    (\1LibraryBase,pc),a6
  52.     ENDM
  53.  
  54. CALL    MACRO
  55.     IFC    "\2",""
  56.     jsr    _LVO\1(a6)
  57.     ELSE
  58.     move.l    (\1LibraryBase,pc),a6
  59.     jsr    _LVO\2(a6)
  60.     ENDC
  61.     ENDM
  62. ;------------------------------------------------------------------------------
  63. MyPicX=320
  64. MyPicY=256
  65. ;------------------------------------------------------------------------------
  66. Start    moveq    #0,d0
  67.     rts
  68. ;------------------------------------------------------------------------------
  69.     ALIGNED
  70. DisplayChunky    GETBASE    Graphics
  71.     cmp.w    #40,(LIB_VERSION,a6)
  72.     blt.b    .NoGraphics40
  73. *******************************************************************************
  74. * NOTES:
  75. * - Graphics/WriteChunkyPixels works the same speed as
  76. *   Graphics/WritePixelArray8, if ChunkyToPlanarHW not presents.
  77. *   Conclusion: Not realy need this two lines:
  78.  
  79.     tst.l    (gb_ChunkyToPlanarPtr,a6)
  80.     beq.b    .NoChunkyToPlanarHW
  81. *******************************************************************************
  82.     bra    WriteChunkyPixels
  83.  
  84. .NoGraphics40
  85. .NoChunkyToPlanarHW    bra    WritePixelArray8
  86. ;------------------------------------------------------------------------------
  87. ;WriteChunkyPixels(rp,xstart,ystart,xstop,ystop,array,bytesperrow)
  88. ;                  A0 D0     D1     D2    D3    A2     D4
  89. ;
  90. ;VOID WriteChunkyPixels(struct  RastPort *, LONG, LONG,
  91. ;     LONG, LONG, UBYTE *, LONG);
  92.  
  93. * NOTES:
  94. * - Your array will not be modified.
  95. * - Dont needs TmpRastPort ( WOW!!! shorter and simplier code).
  96.  
  97.     ALIGNED
  98. WriteChunkyPixels    moveq    #0,d0
  99.     moveq    #0,d1
  100.     move.l    #MyPicX-1,d2
  101.     move.l    #MyPicY-1,d3
  102.     move.l    #MyPicX,d4
  103.     move.l    (PtrMyRastPort,pc),a0
  104.     lea    (ChunkyDatas,pc),a2
  105.     CALL    Graphics,WriteChunkyPixels
  106.     rts
  107. ;------------------------------------------------------------------------------
  108. ;count = WritePixelArray8(rp,xstart,ystart,xstop,ystop,array,temprp)
  109. ;D0                       A0 D0:16  D1:16  D2:16 D3:16  A2   A1
  110. ;
  111. ;LONG WritePixelArray8(struct  RastPort *, UWORD, UWORD,
  112. ;     UWORD, UWORD, UBYTE *, struct  RastPort *);
  113.  
  114. * NOTES:
  115. * - Your array will be cleared.
  116. * - Needs an allocated TmpRastPort.
  117.  
  118.     ALIGNED
  119. WritePixelArray8    moveq    #0,d0
  120.     moveq    #0,d1
  121.     move.l    #MyPicX-1,d2
  122.     move.l    #MyPicY-1,d3
  123.     move.l    (PtrMyRastPort,pc),a0
  124.     move.l    (PtrMyTmpRastPort,pc),a1
  125.     lea    (ChunkyDatas,pc),a2
  126.     CALL    Graphics,WritePixelArray8
  127.     rts
  128. ;------------------------------------------------------------------------------
  129.     ALIGNED
  130. GraphicsLibraryBase    dc.l    0
  131. PtrMyRastPort    dc.l    0
  132. PtrMyTmpRastPort    dc.l    0
  133.  
  134. ChunkyDatas    dcb.b    MyPicX*MyPicY,0
  135. ;------------------------------------------------------------------------------
  136.     END
  137.